#define _CRT_SECURE_NO_WARNINGS 1;
#include<stdio.h>

int get_number(long long N)
{
    static int n = 1;
    if (N >= 10)
    {
        n++;
        return get_number(N / 10);
    }
    return n;
}

int main()
{
    long long N = 0;
    int n = 0;
    int a = 1;
    int b = 1;
    scanf("%lld", &N);
    n = get_number(N);
    char arr[13] = { 0 };
    if (n > 3 && n <= 6)
    {
        n = n + 1;
    }
    else if (n > 6 && n <= 9)
    {
        n = n + 2;
    }
    else if (n > 9 && n <= 10)
    {
        n = n + 3;
    }
    for (int i = 0; i < n; i++)
    {
        if (n % 3 == 0)
        {
            arr[i] = ',';
            continue;
        }
        a *= 10;
        
        arr[i] = N /b % a;
        b *= 10;
    }
    for (int i = 0; i < n; i++)
    {
        printf("%c ", arr[i]);
    }
    //printf("%d", arr[0]);
    return 0;
}